﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace JuCloudy.App.Toursim.Root.ctrls
{
    public partial class StepItem : UserControl
    {
        public StepItem()
        {
            InitializeComponent();

            this.Loaded += (obj, e) =>
            {
                this.OnLoad();
            };
        }

        public String Text
        {
            get { return this._txt.Text; }
            set { this._txt.Text = value; }
        }

        public void Active()
        {
            this._back.Visibility = Visibility.Visible ;
            this._txt.Foreground = new SolidColorBrush(Colors.White);
        }

        public void Deactivate()
        {
            this._back.Visibility = Visibility.Collapsed;
            this._txt.Foreground = new SolidColorBrush(Colors.Black);
        }

        public event RoutedEventHandler Click;

        private void OnLoad()
        {
            this._btn.Click += (obj, e) =>
            {
                if (this.Click != null)
                {
                    this.Click.Invoke(obj, e);
                }
            };
        }
    }
}
